<html>
<head><meta charset="utf-8"><title>pre-pre-pre RFC: safe casting of slices · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/pre-pre-pre.20RFC.3A.20safe.20casting.20of.20slices.html">pre-pre-pre RFC: safe casting of slices</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241672677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/pre-pre-pre%20RFC%3A%20safe%20casting%20of%20slices/near/241672677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Demi Obenour <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/pre-pre-pre.20RFC.3A.20safe.20casting.20of.20slices.html#241672677">(Jun 06 2021 at 04:49)</a>:</h4>
<p>Basically can we make <code>bytemuck</code> part of <code>core</code>?  There is an RFC (already accepted) for safe transmutes, but that is a lot of work, while <code>bytemuck</code> already exists.</p>



<a name="241684607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/pre-pre-pre%20RFC%3A%20safe%20casting%20of%20slices/near/241684607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/pre-pre-pre.20RFC.3A.20safe.20casting.20of.20slices.html#241684607">(Jun 06 2021 at 10:20)</a>:</h4>
<p>bytemuck already is no-std. would there be any benefit putting it in core?</p>



<a name="241694264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/pre-pre-pre%20RFC%3A%20safe%20casting%20of%20slices/near/241694264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/pre-pre-pre.20RFC.3A.20safe.20casting.20of.20slices.html#241694264">(Jun 06 2021 at 14:23)</a>:</h4>
<p>Without the additional magic that the safe-transmute project promises, I don't believe that bytemuck can get any better right now. Adding it to core wouldn't really give it anything new it could deliver.</p>
<p>Once the safe-transmute project stabilizes, bytemuck would (most likely) be able to relax the Pod bound and allow even more casts than are currently possible, including (again, probably) even more slice casts than are currently possible.</p>
<p>PS: &lt;3 u <span class="user-mention" data-user-id="219211">@Jack Wrenn</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>